package com.sbtr.business.publishtask.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sbtr.business.publishtask.entity.PublishTaskData;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 数据类部署任务表 Mapper 接口
 * </p>
 * 

 */
public interface PublishTaskDataMapper extends BaseMapper<PublishTaskData> {

	/**
	 * 通过模型和任务状态，批量查询记录，结果无序
	 *
	 * @param modelId
	 *            - 模型id
	 * @param status
	 *            - 任务状态 @link
	 *            com.sbtr.business.publishtask.dto.PublishTaskDto
	 * @return 任务记录列表，若无，返回empty list
	 */
	List<PublishTaskData> listByModelStatus(@Param("modelId") Long modelId, @Param("status") String status);

	/**
	 * 通过模型id，获取最新一条任务记录<br>
	 * 若无，返回null
	 *
	 * @author qiujun
	 * @date 2019-10-30
	 * @param modelId
	 *            - 模型id
	 * @return
	 */
	PublishTaskData getNewestByModel(@Param("modelId") Long modelId);

}
